﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CH02_02
{
    class CH02_02
    {
        static void Main(string[] args)
        {
            // 声明变量和常量;
            double circleRadius, circleArea, circleCircumference;
            const double PI = 3.1415926;
            string strInput;

            // 接收输入数据,转换为浮点数;
            Console.WriteLine("请输入圆的半径:");
            strInput = Console.ReadLine();

            circleRadius = double.Parse(strInput);

            // 计算圆的面积和圆的周长;
            circleArea = PI * circleRadius * circleRadius;
            circleCircumference = 2 * PI * circleRadius;

            // 将计算结果输出到控制台;
            Console.Write("圆的面积为:{0}", circleArea + "\n");
            Console.WriteLine("圆的周长为:" + circleCircumference);
        }
    }
}
